package com.zero.lite.dao.service.impl;

import com.zero.lite.dao.entity.RegionArea;
import com.zero.lite.dao.mapper.RegionAreaMapper;
import com.zero.lite.dao.service.IRegionAreaService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zero
 * @since 2018-05-04
 */
@Service
public class RegionAreaServiceImpl extends ServiceImpl<RegionAreaMapper, RegionArea> implements IRegionAreaService {

    @Autowired
    private RegionAreaMapper regionAreaMapper;

    @Override
    @Cacheable(value = "REGION",key = "#code")
    public String regionName(Integer code) {
        return regionAreaMapper.selectById(code).getName();
    }
}
